c = 0
pi = 0.0
for i in range(1, 1000000, 2):
    c += 1
    if c % 2 == 0:
        i *= -1
    pi += 1/i
print(f"pi的近似值为:{4 * pi}")
